﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_CX_KAOHESL实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_CX_KAOHESL
    {
        private decimal? m_dec_i_acity;

        private decimal? m_dec_i_acity_g;

        private decimal? m_dec_i_acity_u;

        private decimal? m_dec_i_asub;

        private decimal? m_dec_i_asub_g;

        private decimal? m_dec_i_asub_u;

        private decimal? m_dec_i_aunder;

        private decimal? m_dec_i_aunder_g;

        private decimal? m_dec_i_aunder_u;

        private decimal? m_dec_i_aundersc;

        private decimal? m_dec_i_aundersc_g;

        private decimal? m_dec_i_aundersc_u;

        private decimal? m_dec_i_aup;

        private decimal? m_dec_i_aup_g;

        private decimal? m_dec_i_aup_u;

        private decimal? m_dec_i_scity;

        private decimal? m_dec_i_scity_g;

        private decimal? m_dec_i_scity_u;

        private decimal? m_dec_i_ssub;

        private decimal? m_dec_i_ssub_g;

        private decimal? m_dec_i_ssub_u;

        private decimal? m_dec_i_sunder;

        private decimal? m_dec_i_sunder_g;

        private decimal? m_dec_i_sunder_u;

        private decimal? m_dec_i_sundersc;

        private decimal? m_dec_i_sundersc_g;

        private decimal? m_dec_i_sundersc_u;

        private decimal? m_dec_i_sup;

        private decimal? m_dec_i_sup_g;

        private decimal? m_dec_i_sup_u;

        private decimal? m_dec_i_ykhsl;

        private decimal m_dec_id;

        private string m_str_i_m;

        private string m_str_i_y;

        private string m_str_s_by1;

        private string m_str_s_by2;

        private string m_str_s_by3;

        /// <summary>
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        /// </summary>
        public string I_Y
        {
            get { return m_str_i_y; }
            set { m_str_i_y = value; }
        }

        /// <summary>
        /// </summary>
        public string I_M
        {
            get { return m_str_i_m; }
            set { m_str_i_m = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_YKHSL
        {
            get { return m_dec_i_ykhsl; }
            set { m_dec_i_ykhsl = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SCITY
        {
            get { return m_dec_i_scity; }
            set { m_dec_i_scity = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SCITY_G
        {
            get { return m_dec_i_scity_g; }
            set { m_dec_i_scity_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SCITY_U
        {
            get { return m_dec_i_scity_u; }
            set { m_dec_i_scity_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_ACITY
        {
            get { return m_dec_i_acity; }
            set { m_dec_i_acity = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_ACITY_G
        {
            get { return m_dec_i_acity_g; }
            set { m_dec_i_acity_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_ACITY_U
        {
            get { return m_dec_i_acity_u; }
            set { m_dec_i_acity_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SSUB
        {
            get { return m_dec_i_ssub; }
            set { m_dec_i_ssub = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SSUB_G
        {
            get { return m_dec_i_ssub_g; }
            set { m_dec_i_ssub_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SSUB_U
        {
            get { return m_dec_i_ssub_u; }
            set { m_dec_i_ssub_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_ASUB
        {
            get { return m_dec_i_asub; }
            set { m_dec_i_asub = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_ASUB_G
        {
            get { return m_dec_i_asub_g; }
            set { m_dec_i_asub_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_ASUB_U
        {
            get { return m_dec_i_asub_u; }
            set { m_dec_i_asub_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUP
        {
            get { return m_dec_i_sup; }
            set { m_dec_i_sup = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUP_G
        {
            get { return m_dec_i_sup_g; }
            set { m_dec_i_sup_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUP_U
        {
            get { return m_dec_i_sup_u; }
            set { m_dec_i_sup_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUP
        {
            get { return m_dec_i_aup; }
            set { m_dec_i_aup = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUP_G
        {
            get { return m_dec_i_aup_g; }
            set { m_dec_i_aup_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUP_U
        {
            get { return m_dec_i_aup_u; }
            set { m_dec_i_aup_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUNDER
        {
            get { return m_dec_i_sunder; }
            set { m_dec_i_sunder = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUNDER_G
        {
            get { return m_dec_i_sunder_g; }
            set { m_dec_i_sunder_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUNDER_U
        {
            get { return m_dec_i_sunder_u; }
            set { m_dec_i_sunder_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUNDER
        {
            get { return m_dec_i_aunder; }
            set { m_dec_i_aunder = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUNDER_G
        {
            get { return m_dec_i_aunder_g; }
            set { m_dec_i_aunder_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUNDER_U
        {
            get { return m_dec_i_aunder_u; }
            set { m_dec_i_aunder_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUNDERSC
        {
            get { return m_dec_i_sundersc; }
            set { m_dec_i_sundersc = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUNDERSC_G
        {
            get { return m_dec_i_sundersc_g; }
            set { m_dec_i_sundersc_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_SUNDERSC_U
        {
            get { return m_dec_i_sundersc_u; }
            set { m_dec_i_sundersc_u = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUNDERSC
        {
            get { return m_dec_i_aundersc; }
            set { m_dec_i_aundersc = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUNDERSC_G
        {
            get { return m_dec_i_aundersc_g; }
            set { m_dec_i_aundersc_g = value; }
        }

        /// <summary>
        /// </summary>
        public decimal? I_AUNDERSC_U
        {
            get { return m_dec_i_aundersc_u; }
            set { m_dec_i_aundersc_u = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BY1
        {
            get { return m_str_s_by1; }
            set { m_str_s_by1 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BY2
        {
            get { return m_str_s_by2; }
            set { m_str_s_by2 = value; }
        }

        /// <summary>
        /// </summary>
        public string S_BY3
        {
            get { return m_str_s_by3; }
            set { m_str_s_by3 = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_CX_KAOHESLProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_CX_KAOHESLProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_CX_KAOHESL实体添加或者修改YS_CX_KAOHESL信息
        /// </summary>
        public bool InsertOrUpdate(YS_CX_KAOHESL YS_CX_KAOHESL, OracleTransaction Transaction)
        {
            if (YS_CX_KAOHESL.ID == 0)
                InsertYS_CX_KAOHESL(YS_CX_KAOHESL, Transaction);
            else
                UpdateYS_CX_KAOHESL(YS_CX_KAOHESL, Transaction);
            return YS_CX_KAOHESL.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_CX_KAOHESL实体添加或修改YS_CX_KAOHESL信息
        /// </summary>
        public bool InsertOrUpdate(YS_CX_KAOHESL YS_CX_KAOHESL)
        {
            return InsertOrUpdate(YS_CX_KAOHESL, null);
        }


        /// <summary>
        ///     根据YS_CX_KAOHESL主键删除YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_CX_KAOHESL(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_CX_KAOHESL";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_CX_KAOHESL主键删除YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_CX_KAOHESL(decimal ID)
        {
            return DeleteYS_CX_KAOHESL(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_CX_KAOHESLsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_CX_KAOHESLsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_CX_KAOHESLsDynamic(string WhereClause)
        {
            return DeleteYS_CX_KAOHESLsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_CX_KAOHESL主键选择YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_CX_KAOHESL信息</returns>
        public YS_CX_KAOHESL SelectYS_CX_KAOHESL(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CX_KAOHESL";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_CX_KAOHESL = PopulateYS_CX_KAOHESL(rd);
                rd.Close();
                return YS_CX_KAOHESL;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_CX_KAOHESL主键选择YS_CX_KAOHESL信息
        /// </summary>
        /// <returns>YS_CX_KAOHESL信息</returns>
        public YS_CX_KAOHESL SelectYS_CX_KAOHESL(decimal ID)
        {
            return SelectYS_CX_KAOHESL(ID, null);
        }

        /// <summary>
        ///     选择所有YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_CX_KAOHESL信息</returns>
        public DataTable SelectYS_CX_KAOHESLsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CX_KAOHESLsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_CX_KAOHESL信息
        /// </summary>
        /// <returns>所有YS_CX_KAOHESL信息</returns>
        public DataTable SelectYS_CX_KAOHESLsAll()
        {
            return SelectYS_CX_KAOHESLsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_CX_KAOHESL信息</returns>
        public DataTable SelectYS_CX_KAOHESLsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CX_KAOHESLsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_CX_KAOHESL信息</returns>
        public DataTable SelectYS_CX_KAOHESLsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_CX_KAOHESLsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_CX_KAOHESL信息</returns>
        public DataTable SelectYS_CX_KAOHESLsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_CX_KAOHESLsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_CX_KAOHESL信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_CX_KAOHESL信息</returns>
        public DataTable SelectYS_CX_KAOHESLsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_CX_KAOHESLsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_CX_KAOHESL字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_CX_KAOHESLsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_CX_KAOHESLDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_CX_KAOHESL字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_CX_KAOHESLsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_CX_KAOHESLsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_CX_KAOHESL(YS_CX_KAOHESL YS_CX_KAOHESL, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_CX_KAOHESL";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_CX_KAOHESL.I_Y;
            storedParams[1].Value = YS_CX_KAOHESL.I_M;
            storedParams[2].Value = YS_CX_KAOHESL.I_YKHSL;
            storedParams[3].Value = YS_CX_KAOHESL.I_SCITY;
            storedParams[4].Value = YS_CX_KAOHESL.I_SCITY_G;
            storedParams[5].Value = YS_CX_KAOHESL.I_SCITY_U;
            storedParams[6].Value = YS_CX_KAOHESL.I_ACITY;
            storedParams[7].Value = YS_CX_KAOHESL.I_ACITY_G;
            storedParams[8].Value = YS_CX_KAOHESL.I_ACITY_U;
            storedParams[9].Value = YS_CX_KAOHESL.I_SSUB;
            storedParams[10].Value = YS_CX_KAOHESL.I_SSUB_G;
            storedParams[11].Value = YS_CX_KAOHESL.I_SSUB_U;
            storedParams[12].Value = YS_CX_KAOHESL.I_ASUB;
            storedParams[13].Value = YS_CX_KAOHESL.I_ASUB_G;
            storedParams[14].Value = YS_CX_KAOHESL.I_ASUB_U;
            storedParams[15].Value = YS_CX_KAOHESL.I_SUP;
            storedParams[16].Value = YS_CX_KAOHESL.I_SUP_G;
            storedParams[17].Value = YS_CX_KAOHESL.I_SUP_U;
            storedParams[18].Value = YS_CX_KAOHESL.I_AUP;
            storedParams[19].Value = YS_CX_KAOHESL.I_AUP_G;
            storedParams[20].Value = YS_CX_KAOHESL.I_AUP_U;
            storedParams[21].Value = YS_CX_KAOHESL.I_SUNDER;
            storedParams[22].Value = YS_CX_KAOHESL.I_SUNDER_G;
            storedParams[23].Value = YS_CX_KAOHESL.I_SUNDER_U;
            storedParams[24].Value = YS_CX_KAOHESL.I_AUNDER;
            storedParams[25].Value = YS_CX_KAOHESL.I_AUNDER_G;
            storedParams[26].Value = YS_CX_KAOHESL.I_AUNDER_U;
            storedParams[27].Value = YS_CX_KAOHESL.I_SUNDERSC;
            storedParams[28].Value = YS_CX_KAOHESL.I_SUNDERSC_G;
            storedParams[29].Value = YS_CX_KAOHESL.I_SUNDERSC_U;
            storedParams[30].Value = YS_CX_KAOHESL.I_AUNDERSC;
            storedParams[31].Value = YS_CX_KAOHESL.I_AUNDERSC_G;
            storedParams[32].Value = YS_CX_KAOHESL.I_AUNDERSC_U;
            storedParams[33].Value = YS_CX_KAOHESL.S_BY1;
            storedParams[34].Value = YS_CX_KAOHESL.S_BY2;
            storedParams[35].Value = YS_CX_KAOHESL.S_BY3;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_CX_KAOHESL.ID = Convert.ToInt32(storedParams[36].Value);
            return result;
        }

        private bool UpdateYS_CX_KAOHESL(YS_CX_KAOHESL YS_CX_KAOHESL, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_CX_KAOHESL";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_CX_KAOHESL.I_Y;
            storedParams[1].Value = YS_CX_KAOHESL.I_M;
            storedParams[2].Value = YS_CX_KAOHESL.I_YKHSL;
            storedParams[3].Value = YS_CX_KAOHESL.I_SCITY;
            storedParams[4].Value = YS_CX_KAOHESL.I_SCITY_G;
            storedParams[5].Value = YS_CX_KAOHESL.I_SCITY_U;
            storedParams[6].Value = YS_CX_KAOHESL.I_ACITY;
            storedParams[7].Value = YS_CX_KAOHESL.I_ACITY_G;
            storedParams[8].Value = YS_CX_KAOHESL.I_ACITY_U;
            storedParams[9].Value = YS_CX_KAOHESL.I_SSUB;
            storedParams[10].Value = YS_CX_KAOHESL.I_SSUB_G;
            storedParams[11].Value = YS_CX_KAOHESL.I_SSUB_U;
            storedParams[12].Value = YS_CX_KAOHESL.I_ASUB;
            storedParams[13].Value = YS_CX_KAOHESL.I_ASUB_G;
            storedParams[14].Value = YS_CX_KAOHESL.I_ASUB_U;
            storedParams[15].Value = YS_CX_KAOHESL.I_SUP;
            storedParams[16].Value = YS_CX_KAOHESL.I_SUP_G;
            storedParams[17].Value = YS_CX_KAOHESL.I_SUP_U;
            storedParams[18].Value = YS_CX_KAOHESL.I_AUP;
            storedParams[19].Value = YS_CX_KAOHESL.I_AUP_G;
            storedParams[20].Value = YS_CX_KAOHESL.I_AUP_U;
            storedParams[21].Value = YS_CX_KAOHESL.I_SUNDER;
            storedParams[22].Value = YS_CX_KAOHESL.I_SUNDER_G;
            storedParams[23].Value = YS_CX_KAOHESL.I_SUNDER_U;
            storedParams[24].Value = YS_CX_KAOHESL.I_AUNDER;
            storedParams[25].Value = YS_CX_KAOHESL.I_AUNDER_G;
            storedParams[26].Value = YS_CX_KAOHESL.I_AUNDER_U;
            storedParams[27].Value = YS_CX_KAOHESL.I_SUNDERSC;
            storedParams[28].Value = YS_CX_KAOHESL.I_SUNDERSC_G;
            storedParams[29].Value = YS_CX_KAOHESL.I_SUNDERSC_U;
            storedParams[30].Value = YS_CX_KAOHESL.I_AUNDERSC;
            storedParams[31].Value = YS_CX_KAOHESL.I_AUNDERSC_G;
            storedParams[32].Value = YS_CX_KAOHESL.I_AUNDERSC_U;
            storedParams[33].Value = YS_CX_KAOHESL.S_BY1;
            storedParams[34].Value = YS_CX_KAOHESL.S_BY2;
            storedParams[35].Value = YS_CX_KAOHESL.S_BY3;
            storedParams[36].Value = YS_CX_KAOHESL.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_CX_KAOHESL PopulateYS_CX_KAOHESL(IDataReader dr)
        {
            var YS_CX_KAOHESL = new YS_CX_KAOHESL();
            YS_CX_KAOHESL.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_CX_KAOHESL.I_Y = dr["I_Y"] == DBNull.Value ? null : (string) dr["I_Y"];
            YS_CX_KAOHESL.I_M = dr["I_M"] == DBNull.Value ? null : (string) dr["I_M"];
            YS_CX_KAOHESL.I_YKHSL = dr["I_YKHSL"] == DBNull.Value ? null : (decimal?) dr["I_YKHSL"];
            YS_CX_KAOHESL.I_SCITY = dr["I_SCITY"] == DBNull.Value ? null : (decimal?) dr["I_SCITY"];
            YS_CX_KAOHESL.I_SCITY_G = dr["I_SCITY_G"] == DBNull.Value ? null : (decimal?) dr["I_SCITY_G"];
            YS_CX_KAOHESL.I_SCITY_U = dr["I_SCITY_U"] == DBNull.Value ? null : (decimal?) dr["I_SCITY_U"];
            YS_CX_KAOHESL.I_ACITY = dr["I_ACITY"] == DBNull.Value ? null : (decimal?) dr["I_ACITY"];
            YS_CX_KAOHESL.I_ACITY_G = dr["I_ACITY_G"] == DBNull.Value ? null : (decimal?) dr["I_ACITY_G"];
            YS_CX_KAOHESL.I_ACITY_U = dr["I_ACITY_U"] == DBNull.Value ? null : (decimal?) dr["I_ACITY_U"];
            YS_CX_KAOHESL.I_SSUB = dr["I_SSUB"] == DBNull.Value ? null : (decimal?) dr["I_SSUB"];
            YS_CX_KAOHESL.I_SSUB_G = dr["I_SSUB_G"] == DBNull.Value ? null : (decimal?) dr["I_SSUB_G"];
            YS_CX_KAOHESL.I_SSUB_U = dr["I_SSUB_U"] == DBNull.Value ? null : (decimal?) dr["I_SSUB_U"];
            YS_CX_KAOHESL.I_ASUB = dr["I_ASUB"] == DBNull.Value ? null : (decimal?) dr["I_ASUB"];
            YS_CX_KAOHESL.I_ASUB_G = dr["I_ASUB_G"] == DBNull.Value ? null : (decimal?) dr["I_ASUB_G"];
            YS_CX_KAOHESL.I_ASUB_U = dr["I_ASUB_U"] == DBNull.Value ? null : (decimal?) dr["I_ASUB_U"];
            YS_CX_KAOHESL.I_SUP = dr["I_SUP"] == DBNull.Value ? null : (decimal?) dr["I_SUP"];
            YS_CX_KAOHESL.I_SUP_G = dr["I_SUP_G"] == DBNull.Value ? null : (decimal?) dr["I_SUP_G"];
            YS_CX_KAOHESL.I_SUP_U = dr["I_SUP_U"] == DBNull.Value ? null : (decimal?) dr["I_SUP_U"];
            YS_CX_KAOHESL.I_AUP = dr["I_AUP"] == DBNull.Value ? null : (decimal?) dr["I_AUP"];
            YS_CX_KAOHESL.I_AUP_G = dr["I_AUP_G"] == DBNull.Value ? null : (decimal?) dr["I_AUP_G"];
            YS_CX_KAOHESL.I_AUP_U = dr["I_AUP_U"] == DBNull.Value ? null : (decimal?) dr["I_AUP_U"];
            YS_CX_KAOHESL.I_SUNDER = dr["I_SUNDER"] == DBNull.Value ? null : (decimal?) dr["I_SUNDER"];
            YS_CX_KAOHESL.I_SUNDER_G = dr["I_SUNDER_G"] == DBNull.Value ? null : (decimal?) dr["I_SUNDER_G"];
            YS_CX_KAOHESL.I_SUNDER_U = dr["I_SUNDER_U"] == DBNull.Value ? null : (decimal?) dr["I_SUNDER_U"];
            YS_CX_KAOHESL.I_AUNDER = dr["I_AUNDER"] == DBNull.Value ? null : (decimal?) dr["I_AUNDER"];
            YS_CX_KAOHESL.I_AUNDER_G = dr["I_AUNDER_G"] == DBNull.Value ? null : (decimal?) dr["I_AUNDER_G"];
            YS_CX_KAOHESL.I_AUNDER_U = dr["I_AUNDER_U"] == DBNull.Value ? null : (decimal?) dr["I_AUNDER_U"];
            YS_CX_KAOHESL.I_SUNDERSC = dr["I_SUNDERSC"] == DBNull.Value ? null : (decimal?) dr["I_SUNDERSC"];
            YS_CX_KAOHESL.I_SUNDERSC_G = dr["I_SUNDERSC_G"] == DBNull.Value ? null : (decimal?) dr["I_SUNDERSC_G"];
            YS_CX_KAOHESL.I_SUNDERSC_U = dr["I_SUNDERSC_U"] == DBNull.Value ? null : (decimal?) dr["I_SUNDERSC_U"];
            YS_CX_KAOHESL.I_AUNDERSC = dr["I_AUNDERSC"] == DBNull.Value ? null : (decimal?) dr["I_AUNDERSC"];
            YS_CX_KAOHESL.I_AUNDERSC_G = dr["I_AUNDERSC_G"] == DBNull.Value ? null : (decimal?) dr["I_AUNDERSC_G"];
            YS_CX_KAOHESL.I_AUNDERSC_U = dr["I_AUNDERSC_U"] == DBNull.Value ? null : (decimal?) dr["I_AUNDERSC_U"];
            YS_CX_KAOHESL.S_BY1 = dr["S_BY1"] == DBNull.Value ? null : (string) dr["S_BY1"];
            YS_CX_KAOHESL.S_BY2 = dr["S_BY2"] == DBNull.Value ? null : (string) dr["S_BY2"];
            YS_CX_KAOHESL.S_BY3 = dr["S_BY3"] == DBNull.Value ? null : (string) dr["S_BY3"];
            return YS_CX_KAOHESL;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion